home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
u_man
/
cat3
/
Tk
/
bindtable.z
/
bindtable
Wrap
Text File
|
1998-10-30
|
13KB
|
199 lines
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk)))) TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
NNNNAAAAMMMMEEEE
Tk_CreateBindingTable, Tk_DeleteBindingTable, Tk_CreateBinding,
Tk_DeleteBinding, Tk_GetBinding, Tk_GetAllBindings, Tk_DeleteAllBindings,
Tk_BindEvent - invoke scripts in response to X events
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
Tk_BindingTable
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((_i_n_t_e_r_p))))
TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((_b_i_n_d_i_n_g_T_a_b_l_e))))
unsigned long
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g, _s_c_r_i_p_t, _a_p_p_e_n_d))))
int
TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g))))
char *
TTTTkkkk____GGGGeeeettttBBBBiiiinnnnddddiiiinnnngggg((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t, _e_v_e_n_t_S_t_r_i_n_g))))
TTTTkkkk____GGGGeeeettttAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss((((_i_n_t_e_r_p, _b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t))))
TTTTkkkk____DDDDeeeelllleeeetttteeeeAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss((((_b_i_n_d_i_n_g_T_a_b_l_e, _o_b_j_e_c_t))))
TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt((((_b_i_n_d_i_n_g_T_a_b_l_e, _e_v_e_n_t_P_t_r, _t_k_w_i_n, _n_u_m_O_b_j_e_c_t_s, _o_b_j_e_c_t_P_t_r))))
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
Tcl_Interp *_i_n_t_e_r_p (in) Interpreter to use when
invoking bindings in binding
table. Also used for
returning results and errors
from binding procedures.
Tk_BindingTable _b_i_n_d_i_n_g_T_a_b_l_e (in) Token for binding table; must
have been returned by some
previous call to
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee.
ClientData _o_b_j_e_c_t (in) Identifies object with which
binding is associated.
char *_e_v_e_n_t_S_t_r_i_n_g (in) String describing event
sequence.
char *_s_c_r_i_p_t (in) Tcl script to invoke when
binding triggers.
int _a_p_p_e_n_d (in) Non-zero means append _s_c_r_i_p_t
to existing script for
binding, if any; zero means
PPPPaaaaggggeeee 1111
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk)))) TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
replace existing script with
new one.
XEvent *_e_v_e_n_t_P_t_r (in) X event to match against
bindings in _b_i_n_d_i_n_g_T_a_b_l_e.
Tk_Window _t_k_w_i_n (in) Identifier for any window on
the display where the event
occurred. Used to find
display-related information
such as key maps.
int _n_u_m_O_b_j_e_c_t_s (in) Number of object identifiers
pointed to by _o_b_j_e_c_t_P_t_r.
ClientData *_o_b_j_e_c_t_P_t_r (in) Points to an array of object
identifiers: bindings will be
considered for each of these
objects in order from first to
last.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
These procedures provide a general-purpose mechanism for creating and
invoking bindings. Bindings are organized in terms of _b_i_n_d_i_n_g _t_a_b_l_e_s. A
binding table consists of a collection of bindings plus a history of
recent events. Within a binding table, bindings are associated with
_o_b_j_e_c_t_s. The meaning of an object is defined by clients of the binding
package. For example, Tk keeps uses one binding table to hold all of the
bindings created by the bbbbiiiinnnndddd command. For this table, objects are
pointers to strings such as window names, class names, or other binding
tags such as aaaallllllll. Tk also keeps a separate binding table for each canvas
widget, which manages bindings created by the canvas's bbbbiiiinnnndddd widget
command; within this table, an object is either a pointer to the
internal structure for a canvas item or a Tk_Uid identifying a tag.
The procedure TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee creates a new binding table and
associates _i_n_t_e_r_p with it (when bindings in the table are invoked, the
scripts will be evaluated in _i_n_t_e_r_p). TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee returns a
token for the table, which must be used in calls to other procedures such
as TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg or TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt.
TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee frees all of the state associated with a binding
table. Once it returns the caller should not use the _b_i_n_d_i_n_g_T_a_b_l_e token
again.
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg adds a new binding to an existing table. The _o_b_j_e_c_t
argument identifies the object with which the binding is to be
associated, and it may be any one-word value. Typically it is a pointer
to a string or data structure. The _e_v_e_n_t_S_t_r_i_n_g argument identifies the
event or sequence of events for the binding; see the documentation for
the bbbbiiiinnnndddd command for a description of its format. _s_c_r_i_p_t is the Tcl
PPPPaaaaggggeeee 2222
TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk)))) TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnnggggTTTTaaaabbbblllleeee((((3333TTTTkkkk))))
script to be evaluated when the binding triggers. _a_p_p_e_n_d indicates what
to do if there already exists a binding for _o_b_j_e_c_t and _e_v_e_n_t_S_t_r_i_n_g: if
_a_p_p_e_n_d is zero then _s_c_r_i_p_t replaces the old script; if _a_p_p_e_n_d is non-
zero then the new script is appended to the old one. TTTTkkkk____CCCCrrrreeeeaaaatttteeeeBBBBiiiinnnnddddiiiinnnngggg
returns an X event mask for all the events associated with the bindings.
This information may be useful to invoke XXXXSSSSeeeelllleeeeccccttttIIIInnnnppppuuuutttt to select relevant
events, or to disallow the use of certain events in bindings. If an
error occurred while creating the binding (e.g., _e_v_e_n_t_S_t_r_i_n_g refers to a
non-existent event), then 0 is returned and an error message is left in
_i_n_t_e_r_p->_r_e_s_u_l_t.
TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg removes from _b_i_n_d_i_n_g_T_a_b_l_e the binding given by _o_b_j_e_c_t
and _e_v_e_n_t_S_t_r_i_n_g, if such a binding exists. TTTTkkkk____DDDDeeeelllleeeetttteeeeBBBBiiiinnnnddddiiiinnnngggg always
returns TCL_OK. In some cases it may reset _i_n_t_e_r_p->_r_e_s_u_l_t to the default
empty value.
TTTTkkkk____GGGGeeeettttBBBBiiiinnnnddddiiiinnnngggg returns a pointer to the script associated with _e_v_e_n_t_S_t_r_i_n_g
and _o_b_j_e_c_t in _b_i_n_d_i_n_g_T_a_b_l_e. If no such binding exists then NULL is
returned and an error message is left in _i_n_t_e_r_p->_r_e_s_u_l_t.
TTTTkkkk____GGGGeeeettttAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss returns in _i_n_t_e_r_p->_r_e_s_u_l_t a list of all the event
strings for which there are bindings in _b_i_n_d_i_n_g_T_a_b_l_e associated with
_o_b_j_e_c_t. If there are no bindings for _o_b_j_e_c_t then an empty string is
returned in _i_n_t_e_r_p->_r_e_s_u_l_t.
TTTTkkkk____DDDDeeeelllleeeetttteeeeAAAAllllllllBBBBiiiinnnnddddiiiinnnnggggssss deletes all of the bindings in _b_i_n_d_i_n_g_T_a_b_l_e that are
associated with _o_b_j_e_c_t.
TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt is called to process an event. It makes a copy of the event
in an internal history list associated with the binding table, then it
checks for bindings that match the event. TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt processes each of
the objects pointed to by _o_b_j_e_c_t_P_t_r in turn. For each object, it finds
all the bindings that match the current event history, selects the most
specific binding using the priority mechanism described in the
documentation for bbbbiiiinnnndddd, and invokes the script for that binding. If
there are no matching bindings for a particular object, then the object
is skipped. TTTTkkkk____BBBBiiiinnnnddddEEEEvvvveeeennnntttt continues through all of the objects, handling
exceptions such as errors, bbbbrrrreeeeaaaakkkk, and ccccoooonnnnttttiiiinnnnuuuueeee as described in the
documentation for bbbbiiiinnnndddd.
KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
binding, event, object, script
PPPPaaaaggggeeee 3333